package com.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dao.QuestionDao;
import com.entity.Question;
import com.service.QuestionService;
@Service
public class QuestionServiceImpl  implements	QuestionService {

	@Resource
	QuestionDao qd;

	@Override
	public Map list(Map map) {
		map.put("rows", qd.list(map));
		map.put("total", qd.getCount(map));
		return map;
	}

	@Override
	public Question get(Integer id) {
		return qd.get(id);
	}

	@Override
	public boolean add(Question q) {
		if(qd.add(q)>0)
			return true;
		return false;
	}

	@Override
	public boolean edit(Question q) {
		if(qd.edit(q)>0)
			return true;
		return false;
	}

	@Override
	public boolean delete(Integer id) {
		if(qd.delete(id)>0)
			return true;
		return false;
	}
	
}
